package com.brkj.test;

import android.content.Context;
import android.view.View;
import com.brkj.httpInterface.BaseAjaxParams;
import com.brkj.httpInterface.HttpInterface;
import com.brkj.test.model.DS_Exam;
import com.brkj.util.ConstAnts;
import com.brkj.util.MyAjaxCallBack;
import com.brkj.util.MyApplication;
import com.brkj.util.view.BaseCoreActivity;
import com.brkj.util.view.BaseListView;
import com.dgl.sdk.util.DBStore;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import net.tsz.afinal.FinalHttp;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by colin.ding on 2014/5/7.
 */
public class RealExamOfflineView extends BaseListView {

    private List<DS_Exam> offlineExamList = new ArrayList<DS_Exam>();
    public RealExamOfflineView(Context context) {
        super(context);
    }

    @Override
    protected void fillView() {
        offlineExamList = DBStore.readAll(DS_Exam.class, ConstAnts.DB_TABLE_REALL_EXAM_OFFLINE_QUES_LIST);

        fillContentView(offlineExamList, true);
        
    }

    public void show(){
            fillView();

    }



    private void fillContentView(List<DS_Exam> list, boolean isOffLineList){
        if((list != null) &&(list.size()>0)){


            RealExamAdapter adapter = new RealExamAdapter(mContext, list, isOffLineList);
            listView.setAdapter(adapter);

            listView.setVisibility(View.VISIBLE);
            noContent.setVisibility(View.GONE);
        }else{
            listView.setVisibility(View.GONE);
            noContent.setVisibility(View.VISIBLE);
        }
    }
    
    
}